<!--
 * @Author: Li Zengkun
 * @Date: 2022-06-18 21:34:32
 * @LastEditors: Li Zengkun
 * @LastEditTime: 2022-06-29 07:28:01
 * @Description: 
-->
<template>
  <!-- <img alt="Vue logo" src="./assets/logo.png"> -->
  <!-- <HelloWorld msg="Welcome to Your Vue.js App"/> -->
  <HeaderTag></HeaderTag>
  <div id="main">
    <!-- <IndexPage></IndexPage> -->
    <router-view></router-view>
  </div>
  <FooterTag></FooterTag>
</template>

<script>
import HeaderTag from "./components/HeaderTag.vue";
import FooterTag from "./components/FooterTag.vue";

export default {
  name: "App",
  components: {
    HeaderTag,
    FooterTag
  },
  created() {},
  mounted() {
    // console.log(this.isMobileDevice());
    // if(this.isMobileDevice()){
    //   alert('这是移动端')
    // }
  },
  methods: {
    //判断当前设备是否为移动端
    isMobileDevice() {
      const ua = navigator.userAgent.toLowerCase();
      const t1 = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(
        ua
      );
      // match() 返回所有查找的关键字内容的数组
      const t2 = !ua.match("iphone") && navigator.maxTouchPoints > 1;
      return t1 || t2;
    },

    //判断当前设备是手机
    isMobilePhone() {
      const ua = navigator.userAgent.toLowerCase();
      const t1 = /android|webos|iphone|ipod|blackberry|iemobile|opera mini/i.test(ua);
      // const t2 = !ua.match("iphone") && navigator.maxTouchPoints > 1;
      return t1;
    },

    // 是否是IOS
    isIOS() {
      // const ua = navigator.userAgent;
      // return !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
      var u = window.navigator.userAgent;
      var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
      return !isAndroid;
    },
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  /* color: #2c3e50; */
  /* margin-top: 60px; */
}
#main {
  padding-top: 127px;
  height: auto;
}
</style>
